package bud.web.shop.dao;

import java.util.List;

import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import bud.vo.BoardFormDTO;
import bud.vo.ShopDTO;

public class ShopDaoiBatis extends SqlMapClientDaoSupport implements IShopDao{

	public List<ShopDTO> getShopList(BoardFormDTO formDTO) {
		return getSqlMapClientTemplate().queryForList("Shop.getShopList",formDTO);
	}
	
	@Override
	public ShopDTO getShop(int sh_no) {
		return (ShopDTO)getSqlMapClientTemplate().queryForObject("Shop.getShop", sh_no);
	}
	
	@Override
	public int insertShop(ShopDTO shop) {
		return getSqlMapClientTemplate().update("Shop.insertShop",shop);
	}
	
	@Override
	public int updateShop(ShopDTO shop) {
		return getSqlMapClientTemplate().update("Shop.updateShop",shop);
	}
	
	@Override
	public int deleteShop(int sh_no) {
		return getSqlMapClientTemplate().update("Shop.deleteShop",sh_no);
	}

	@Override
	public int getShopCount(BoardFormDTO formDTO) {
		return (int) getSqlMapClientTemplate().queryForObject("Shop.getShopCount", formDTO);
	}

	
}
